/*
 * Copyright(C) 2019 FUYUN DATA SERVICES CO.,LTD. - All Rights Reserved
 * Unauthorized copying of this file, via any medium is strictly prohibited
 * Proprietary and confidential
 * 该源代码版权归属福韵数据服务有限公司所有
 * 未经授权，任何人不得复制、泄露、转载、使用，否则将视为侵权
 *
 */

import { Button } from 'antd';
import * as React from 'react';
import { Link } from 'react-router-dom';
import { homePage } from '../../config/base';
import './Exception.scss';

interface IProps extends React.Props<any> {
  type: string;
  msg?: string;
}

class Exception extends React.Component<IProps, any> {
  public renderException = () => {
    if (this.props.type === '404') {
      return (
        <div>
          <h3>404</h3>
          <h4>{this.props.msg}</h4>
        </div>
      );
    }
    return;
  };
  public render() {
    return (
      <div className="exception">
        <div>
          {this.renderException()}
          <Link to={homePage || '/'}>
            <Button type="primary">回到首页</Button>
          </Link>
        </div>
      </div>
    );
  }
}
export default Exception;
